//
//  KQMessageQuestionContentHeader.swift
//  KangYunYouJia
//
//  Created by zhouxiang on 2020/12/17.
//  Copyright © 2020 zhoux@zzkqdc.com. All rights reserved.
//

import UIKit

class KQMessageQuestionContentHeader: UITableViewHeaderFooterView {

    /// 标题
    @IBOutlet weak var titleLabel: UILabel!
    
    // MARK: - life cycle
    override func awakeFromNib() {
        super.awakeFromNib()
    }
    
    // MARK: - public methods
    /// 设置数据
    public func setData(text: String?) {
        self.titleLabel.text = text
    }
    
    /// 获取高度
    public class func getHeaderHeight(text: String?) -> CGFloat {
        let height = KQChatUtils.shared().sizeThatFits(CGSize(width: 230, height: CGFloat.greatestFiniteMagnitude), font: UIFont(name: KQCHAT_FONT_NAME, size: 15)!, text: text ?? "").height
        return max(44.0, height + 23.0)
    }

}
